:root {
  --bg-color: #f5f7fa;
  --panel-color: #ffffff;
  --primary-color: #2c3e50;
  --accent-color: #4fc3f7;
  --text-color: #333333;
  --border-color: #c4c4c4;
  --hover-color: rgba(79, 195, 247, 0.1);
  --selected-color: rgba(79, 195, 247, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* 文件浏览器 */
.file-explorer {
  display: flex;
  height: calc(100vh - 200px); /* 减去顶部导航和header的高度 */
  background-color: var(--panel-color);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 15px;
}

/* 目录树 */
.directory-tree {
  width: 300px;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.directory-header {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

.directory-header p {
  margin-bottom: 10px;
}

.tree-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 15px;
}

/* 文件内容区 */
.file-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-area {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

/* 树形项目 */
.tree-item {
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 4px;
  margin-bottom: 2px;
  transition: all 0.2s;
}

.tree-item:hover {
  background-color: var(--hover-color);
}

.tree-item.selected {
  background-color: var(--selected-color);
  font-weight: bold;
}

.folder-icon::before {
  content: "📁";
  margin-right: 8px;
}

.file-icon::before {
  content: "📄";
  margin-right: 8px;
}

/* 路径导航 */
.path-navigation {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
}

.path-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: monospace;
  min-width: 0;
}

/* 文件操作按钮 */
.file-actions {
  display: flex;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

/* 按钮样式 */
button {
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

button:hover {
  background-color: var(--accent-color);
}

/* 文本编辑器 */
#fileEditor {
  width: 100%;
  min-height: 80%;
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: monospace;
  resize: vertical;
  line-height: 1.5;
}

/* 隐藏的文件输入 */
#fileInput {
  display: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .file-explorer {
    flex-direction: column;
    height: auto;
  }

  .directory-tree {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .path-navigation {
    flex-wrap: wrap;
  }

  .file-actions {
    flex-wrap: wrap;
  }
}
